package com.itheima.Callable;

import java.util.concurrent.Callable;
//1.定义类，实现Callable接口
public class MyCallable implements Callable<Integer>{
//2.Callable接口重写call方法，有返回值，返回值类型
    //泛型接口可以定义返回值的类型
    @Override
    public Integer call() throws Exception {
        int sum = 2;
        for (int i = 4; i <= 100; i+=2) {
            sum += i;
            System.out.println("子线程1：累加偶数。。。。。"+i);
        }

        return sum;
    }
}
